/* eslint-disable */ 
import { deleteHttp, getHttp, postHttpForm, postHttpJSON, putHttp } from "../service/request";
import { RegisterState } from "../types";
import { RSA } from "../utils";




// 登录
export function loginApi(data: { email: string; pwd: string }) {
  data.pwd = RSA(data.pwd);
  return postHttpForm({
    url: "/health/user/v1/login",
    data,
  });
}

// 查询关注医生列表
export function attentionDoctorList() {
  return getHttp({
    url: "/health/user/verify/v1/findUserDoctorFollowList",
    params: {
      page: 1,
      count: 5,
    },
  });
}

// 注册接口 -  获取验证码
export function getEmailCodeApi(email: string) {
  return postHttpJSON({
    url: "/health/user/v1/sendOutEmailCode",
    params: {
      email,
    },
  });
}
// 注册接口 -  用户信息注册

export function registerApi(params: RegisterState) {
  params.pwd1 = RSA(params.pwd1)
  params.pwd2 = params.pwd1
  return postHttpJSON({
    url: "/health/user/v1/register",
    params: {
      ...params,
    },
  });
}


export function getUserFiles() {
  return getHttp({ url: '/health/user/verify/v1/findUserArchives' })
}

export function deleteUserFiles(archivesId: number) {
  return deleteHttp({
    url: '/health/user/verify/v1/deleteUserArchives',
    params: {
      archivesId
    }
  })
}

export function addUserFile(data) {
  return postHttpJSON({
    url: '/health/user/verify/v1/addUserArchives',
    data
  })
}


export function updateUserFile(data) {
  return putHttp({
    url: '/health/user/verify/v1/updateUserArchives',
    data
  })
}